package com.cr.admin.business.city.service.impl;

import com.cr.admin.business.city.dao.repository.CityRepository;

import com.cr.admin.business.city.pojo.entity.City;
import com.cr.admin.business.city.pojo.param.CityAddParam;
import com.cr.admin.business.city.pojo.param.CityUpdateParam;
import com.cr.admin.business.city.pojo.query.CityQuery;
import com.cr.admin.business.city.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CityServiceImpl implements CityService {
    @Autowired
    private CityRepository cityRepository;

    @Override
    public List<City> list(CityQuery cityQuery) {
        return cityRepository.selectCity(cityQuery);
    }

    @Override
    public void insert(CityAddParam cityAddParam) {
        cityRepository.addCity(cityAddParam);
    }

    @Override
    public void updateById(CityUpdateParam topicUpdateParam) {
        cityRepository.updateById(topicUpdateParam);
    }

    @Override
    public City selectById(Long id) {
        return cityRepository.selectById(id);
    }

    @Override
    public void deleteByIds(List<Long> ids) {
        cityRepository.deleteByIds(ids);
    }
}
